#pragma once
#include "Game/Process/RenderProcess.h"
#include "Render/Tradition/ComputePipeline.h"
#include "Render/Shader/RHIDescriptor.h"
#include "Render/Tradition/RHIFramebuffer.h"
#include "../LocalShader.h"

class SphericalHarmonicsProcess : public RenderProcess
{
	DECLARE_PROCESS(SphericalHarmonicsProcess)

	struct PushConstants
	{
		float width;
		float height;
	};

public:

	PushConstants mPushConstants;

protected:

	virtual void OnInit() override;

	virtual void OnTick(float deltaTime) override;

	virtual void OnResize() override;

protected:



	RefCountPtr<RHITexture> mCubemapImage;

	RefCountPtr<RHISampler> mCubemapSampler;



	RefCountPtr<RHITexture> mIntermediateImage;

	RefCountPtr<RHITexture> mShImage;



	RefCountPtr<RHIDescriptor> mProjectionDescriptor;

	DescriptorMask mProjectionDescriptorMask;



	RefCountPtr<RHIDescriptor> mAddDescriptor;

	DescriptorMask mAddDescriptorMask;



	RefCountPtr<ComputePipeline> mProjectionPipeline;

	RefCountPtr<ComputePipeline> mAddPipeline;




	RefCountPtr<RHICommandBuffer> mCommandBuffer;

	RefCountPtr<RHISemaphore> mWaitGraphicsSemaphore;

	RefCountPtr<RHISemaphore> mSignalComputeSemaphore;

};
